//
//  GZLiveDisablePopupButton.swift
//  GLUZ
//
//  Created by lemon on 2025/3/10.
//

import UIKit

protocol GZLiveDisablePopupButtonDelegate: AnyObject {
    func onLiveDisablePopuButtonPressed()
}

extension GZLiveDisablePopupButtonDelegate {
    func onLiveDisablePopuButtonPressed() { }
}

open class GZLiveDisablePopupButton: UIButton {
    
    weak var delegate: GZLiveDisablePopupButtonDelegate?

    public override init(frame: CGRect) {
        super.init(frame: frame)
        self.layer.cornerRadius = UIkitLiveAdaptLandscapeWidth(18)
        self.layer.masksToBounds = true
        self.backgroundColor = UIColor.colorWithHexString("#000000").withAlphaComponent(0.3)
        self.titleLabel?.numberOfLines = 0
        self.titleLabel?.font = UIFont.systemFont(ofSize: 8, weight: .regular)
        self.setTitle("禁用\n弹窗", for: .normal)
        self.titleLabel?.textAlignment = .center
        self.addTarget(self, action: #selector(buttonClick), for: .touchUpInside)
    }
    
    required public init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    @objc func buttonClick() {
        self.delegate?.onLiveDisablePopuButtonPressed()
    }

}
